import request from '@/utils/request'
import {pramsToQuery} from '@/utils/index'

// 获取审批列表
export function getApprovalList(data) {
  return request({
    url: `/approve/approve/approveInst?${pramsToQuery(data)}`,
    method: 'get',
    data
  })
}

// 获取审批管理
export function getApprovalAdminList(data) {
  return request({
    url: `/approve/approve/approveGroupDefinition?${pramsToQuery(data)}`,
    method: 'get',
    data
  })
}
// 获取审批组
export function getFlowApprove(data) {
  return request({
    url: `/approve/approve/approveGroup`,
    method: 'get',
    data
  })
}
// 获取审批数据
export function getFlowInfo(data) {
  return request({
    url: `/approve/approve/approveDefinition/${data.id}?${pramsToQuery(data)}`,
    method: 'get',
    data
  })
}
// 添加审批数据
export function addFlowInfo(data) {
  return request({
    url: `/approve/approve/approveDefinition`,
    method: 'post',
    data
  })
}
// 审批状态修改（停用、启用）
export function stateFlowInfo(data) {
  return request({
    url: `/approve/approve/approveDefinition/isValid?${pramsToQuery(data)}`,
    method: 'get',
    data
  })
}
// 获取filekey
export function getFileKey(data) {
  return request({
    url: `/approve/approve/seq`,
    method: 'get',
    data
  })
}
